home *** CD-ROM | disk | FTP | other *** search
- /***************************************
- HTBKnob.dll
-
- HTBknob.cpp
-
- Copyright TransEra Corporation 1999
- ***************************************/
-
- #include "stdafx.h"
- #include "HTBknob.h"
- #include "DialogThread.h"
- #include "KnobDlg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- short g_Xpos;
- short g_Ypos;
- long * g_pBasicVar;
- long * RetVal;
- KnobDlg * g_KnobVar;
-
- BEGIN_MESSAGE_MAP(CHTBknobApp, CWinApp)
- //{{AFX_MSG_MAP(CHTBknobApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- CHTBknobApp::CHTBknobApp()
- {
- }
-
- CHTBknobApp theApp;
-
-
- /////////////////////////////////////////////////////////////////////////////
- /*
- Function: Knob
-
- Description: Initializes pointers and passes corrrect data into funtion.
-
- Return type: void
- Argument: long* pBasicVar
- Argument: long* ShortPtr
- Argument: short xpos
- Argument: short ypos
-
- Notes: Initializes the starting positions of the dialog window
- Starts a new thread and is the passage of data from the
- knob back to HTBasic.
-
- */
- void Knob(long* pBasicVar, long* ShortPtr, short xpos, short ypos)
- {
- g_Xpos = xpos;
- g_Ypos = ypos;
-
- if (g_KnobVar == NULL)
- {
- g_pBasicVar = pBasicVar;
- RetVal = ShortPtr;
- CWinThread * pThread = AfxBeginThread(RUNTIME_CLASS (DialogThread)); // create thread to execute dialog
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- /*
- Function: Closeknob
-
- Description: Closes Dialog Box
-
- Return type: void
-
- Notes: Closes dialog box and shuts down CLEANLY the worker thread
- that it was running on.
- */
- void Closeknob()
- {
- if (g_KnobVar != NULL)
- {
- g_KnobVar->KillTimer(1); // stop timer from updating dialog
- g_KnobVar->EndDialog(1); // tell dialog to end
- g_KnobVar = NULL; // set pointer to NULL to show no dialog running (dialog is still shutting down)
-
- }
- }
-